test: fix DeleteModelTest#6846
Merged
kenjis merged 8 commits intocodeigniter4:developfrom Nov 16, 2022
Merged
Conversation
kenjis
commented
Nov 13, 2022
| * If where condition is set, beyond the value was empty (0,'', NULL, etc.), | ||
| * Exception should not be thrown because condition was explicity set | ||
| * If where condition is set, beyond the value was empty (0, '', NULL, etc.), | ||
| * Exception should not be thrown because condition was explicitly set |
Member
Author
There was a problem hiding this comment.
What does "beyond the value was empty" mean?
Member
There was a problem hiding this comment.
Not sure! It seems to be explicitly allowing falsy values?
Member
Author
There was a problem hiding this comment.
I added '' as a test case, because it is here in the comment.
But Postgres does not accept it.
1) CodeIgniter\Models\DeleteModelTest::testDontThrowExceptionWhenSoftDeleteConditionIsSetWithEmptyValue with data set #3 ('')
ErrorException: pg_query(): Query failed: ERROR: invalid input syntax for type integer: ""
LINE 2: WHERE "id" = ''
^
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/Postgre/Connection.php:140
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:666
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:593
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:2079
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Model.php:412
/home/runner/work/CodeIgniter4/CodeIgniter4/system/BaseModel.php:985
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Models/DeleteModelTest.php:163
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:97
Member
Author
There was a problem hiding this comment.
Fixed the comment, and removed the failed test case ('').
MGatner
approved these changes
Nov 13, 2022
MGatner
reviewed
Nov 16, 2022
Co-authored-by: MGatner <mgatner@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist: